var _ajax = require('../../utils/ajax');
Page({

    /**
     * 页面的初始数据
     */
    data: {

    },

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad: function(options) {
        var that = this;
        _ajax.getUserInfo(function(data) {
            if (data.code == 0) {
                that.setData({
                    myData: data.data
                });
            }
        }, this);
        _ajax.getConfig(function (data) {
            if (data.code == 0) {
                that.setData({
                    configData: data.data
                });
            }
        }, this);
    },
    // 打电话
    fnMakePhoneCall: function() {
        var that = this;
        wx.makePhoneCall({
            phoneNumber: that.data.configData.phone
        });
    },
    onShareAppMessage(res) { // 转发
        if (res.from === 'button') {
            // 来自页面内转发按钮
        }
        return {
            title: '鹰之旅',
            path: '/pages/index/index'
        }
    }
})